package com.excel.write.base.impl;


import com.excel.build.Excel;
import com.excel.write.ExcelContent;

import java.util.List;

public class ExcelWrite extends ExcelWriteFile {

    ExcelWrite(String cacheDir, String fileName) {
        super(cacheDir, fileName);
    }

    public static void write(String cacheDir, String fileName, Excel excel) {
        ExcelWriteFile excelWrite = new ExcelWriteFile(cacheDir, fileName);
        excel.start();
        excel.build();
        excel.end();
        List<ExcelContent> excelContents = excel.excelContents();
        excelWrite.write(excelContents);
    }

}
